package what.basic.tree;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;

import what.basic.basiccomponent.*;
public class Jhashtabletree {
	Jhashtabletree(){
		JFrame f=new Jframe().jframe("tree test", 00, 00, true);
		Container cp=f.getContentPane();
		String[] s1={"qingcai","dasuan","dachong"};
		String[] s2={"pingguo","lizi","xiangjiao"};
		String[] s3={"mantou","baozi","jiaozi","hundun","miantiao"};
		Hashtable hs1=new Hashtable();
		Hashtable hs2=new Hashtable();
		hs1.put("shucai", s1);
		hs1.put("shuiguo", s2);
		hs1.put("dianxin", hs2);
		hs2.put("zhongdian", s3);
		Font font=new Font("Dialog",Font.PLAIN,12);
		Enumeration keys=UIManager.getLookAndFeelDefaults().keys();
		while(keys.hasMoreElements()){
			Object key=keys.nextElement();
			if(UIManager.get(key)instanceof Font){
				UIManager.put(keys, font);
			}
		}
		try{
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
		}
		catch(Exception e){
			System.exit(0);
		}
		JTree tree=new JTree(hs1);
		JScrollPane sp=new JScrollPane();
		sp.setViewportView(tree);
		cp.add(sp);
		
		
	}
	public static void main(String[] args) {
		new Jhashtabletree();

	}

}
